#include <Uefi.h>
#include <Library/PrintLib.h>

EFI_STATUS
UefiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
  EFI_STATUS Status   = EFI_SUCCESS;
  UINTN Index         = 0;
  EFI_INPUT_KEY Key   = { 0 };
  CHAR16 StrBuffer[3] = { 0 };

  SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Please type a character");
  SystemTable->BootServices->WaitForEvent(1, &SystemTable->ConIn->WaitForKey, &Index);

  Print("\n");

  Status = SystemTable->ConIn->ReadKeyStroke(SystemTable->ConIn, &Key);

  StrBuffer[0] = Key.UnicodeChar;
  StrBuffer[1] = '\n';

  SystemTable->ConOut->OutputString(SystemTable->ConOut, L"The typed character is: ");
  SystemTable->ConOut->OutputString(SystemTable->ConOut, StrBuffer);

  return EFI_SUCCESS;
}
